package com.agg.controller;


import com.agg.core.base.VoidEnum;
import com.agg.core.base.dto.ExtDTO;
import com.agg.core.base.dto.PaginationDTO;
import com.agg.entity.UserPO;
import com.agg.service.UserService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    /**
     * 获取用户列表
     *
     * @param paginationDTO
     * @return
     */
    @PostMapping("/getUserList")
    public Page<UserPO> getList(
            @RequestBody PaginationDTO<UserPO, VoidEnum, ExtDTO> paginationDTO){
        Page<UserPO> page= userService.loadPage(paginationDTO);
        return page;
    }
}
